﻿using System;
using System.Configuration;
using System.Data;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Payroll.BusinessLogic.EmployeeManagement;
using Payroll.BusinessLogic.Audit;
using Payroll.BusinessLogic.Audit.UsersOnline;
using Payroll.BusinessLogic.Configuration.Settings;
using Payroll.BusinessLogic.Infrastructure;
using Payroll.BusinessLogic.Security;
using Payroll.Common.Utils;
using Payroll.BusinessLogic.CustomerManager;
using Payroll.BusinessLogic.Devices;
using Payroll.BusinessLogic.Discounts;

namespace PayrollHR.Web
{
    public partial class BasePayrollPage : Page
    {
        /// <summary>
        /// Gets a value indicating whether this page is tracked by 'Online Employee' module
        /// </summary>
        public virtual bool TrackedByOnlineEMployeesModule
        {
            get
            {
                return true;
            }
        }

        protected override void OnPreRender(EventArgs e)
        {
            //online user tracking
            //if (this.TrackedByOnlineEMployeesModule)
            //{
            //    this.OnlineUserService.TrackCurrentUser();
            //}

            base.OnPreRender(e);
        }
        #region Services, managers

        public IOnlineUserService OnlineUserService
        {
            get { return IoC.Resolve<IOnlineUserService>(); }
        }
        public ILogService LogService
        {
            get { return IoC.Resolve<ILogService>(); }
        }
        public ISearchLogService SearchLogService
        {
            get { return IoC.Resolve<ISearchLogService>(); }
        }
        public ISettingManager SettingManager
        {
            get { return IoC.Resolve<ISettingManager>(); }
        }
        public IEmployeeService EmployeeService
        {
            get { return IoC.Resolve<IEmployeeService>(); }
        }
        public ICustomerService CustomerService
        {
            get { return IoC.Resolve<ICustomerService>(); }
        }
        public IResultService ResultService
        {
            get { return IoC.Resolve<IResultService>(); }
        }
        public IDeviceService DeviceService
        {
            get { return IoC.Resolve<IDeviceService>(); }
        }
        public IOrderService OrderService
        {
            get { return IoC.Resolve<IOrderService>(); }
        }
        public IDiscountService DiscountService
        {
            get { return IoC.Resolve<IDiscountService>(); }
        }
        public IVoucherService VoucherService
        {
            get { return IoC.Resolve<IVoucherService>(); }
        }
        #endregion
    }
}